-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP Evaluate viability of using HTMX #5913
WIP Evaluate viability of using HTMX #5913
Conversation
b10ecde
to
e7e17e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is a good showcase. We can discuss it in one of the next meetings.
assets/assetpack.def
Outdated
@@ -164,6 +164,9 @@ | |||
! job_next_previous.js | |||
< javascripts/job_next_previous.js | |||
|
|||
! htmx.js | |||
< ../node_modules/htmx.org/dist/htmx.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the size of that file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
160K ./htmx.js
52K ./htmx.min.js
16K ./htmx.min.js.gz
hx-delete="<%= url_for($delete_action => ($context->{type}.'_id' => $context->{id}, comment_id => $comment_id)) %>" | ||
hx-confirm="Do you really want to delete the comment written by <%= $user->name %>?" | ||
hx-target="closest .comment-row, .pinned-comment-row" | ||
hx-swap="outerHTML" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to replace the target element with the response. We want to delete the target element - but of course only if the response was a 200 return code. We also need to decrement the number of comments shown in the tab header (if the comment is part of the test details page).
I guess you've chosen a good example here. That is the case kind of simple case we might be able to use htmx for. However, if it turns out that even this simple case it too complicated we know that we probably don't want to use htmx.
assets/javascripts/comments.js
Outdated
//function deleteComment(deleteButton) { | ||
// const author = deleteButton.dataset.author; | ||
// if (!window.confirm('Do you really want to delete the comment written by ' + author + '?')) { | ||
// return; | ||
// } | ||
// $.ajax({ | ||
// url: deleteButton.dataset.deleteUrl, | ||
// method: 'DELETE', | ||
// success: () => { | ||
// $(deleteButton).parents('.comment-row, .pinned-comment-row').remove(); | ||
// updateNumerOfComments(); | ||
// }, | ||
// error: showXhrError.bind(undefined, "The comment couldn't be deleted: ") | ||
// }); | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to delete the code completely. This way the diff statistics tell use how many lines of custom code we avoided.
t/16-utils-vcs-provider.t
Outdated
@@ -7,7 +7,7 @@ use Test::Most; | |||
use FindBin; | |||
use lib "$FindBin::Bin/lib", "$FindBin::Bin/../external/os-autoinst-common/lib"; | |||
require OpenQA::Test::Database; | |||
use OpenQA::Test::TimeLimit '5'; | |||
use OpenQA::Test::TimeLimit '25'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you bumped the timeout without any other changes it might be worth checking if/why the test is slow for you. Generally it should work unmodified
e7e17e8
to
75eb82a
Compare
This pull request is now in conflicts. Could you fix it? 🙏 |
Related: https://progress.opensuse.org/issues/156055
Draft PR